pkg_name=lilo
version=24.1
src_dir=$src_dir_root/$pkg_name-$version
url=http://lilo.alioth.debian.org/ftp/sources/$pkg_name-$version.tar.gz

cd "$src_dir_root"
rm -Rf "$pkg_name-$version"
tar zxf "$pkg_name-$version.tar.gz"

cd "$src_dir"
cp -f "$builders_dir_root/$pkg_name/Makefile.patch" ./Makefile.patch
patch -Ni ./Makefile.patch

make	"OPT=-O0" "CONFIG=-DBDATA -DDSECS=3 -DIGNORECASE -DNOKEYBOARD \
	-DONE_SHOT -DPASS160 -DREWRITE_TABLE -DSOLO_CHAIN -DVERSION -DNOSERIAL"

install_tmp_dir=/tmp/$pkg_name-$version
rm -Rf "$install_tmp_dir"
make install "DESTDIR=$install_tmp_dir"

#fix lilo installation path
mkdir -p "$install_tmp_dir/bin"
mv "$install_tmp_dir/sbin/lilo" "$install_tmp_dir/bin"

install_dirs "$builders_dir_root/$pkg_name/runtime.dirs"
install_files "$builders_dir_root/$pkg_name/runtime.files" "$install_tmp_dir"
elf_strip "$builders_dir_root/$pkg_name/elf-strip"

rm -Rf "$install_tmp_dir"
rm -Rf "$src_dir"
